package cn.hchaojie.camp.day05.oop;

import java.util.Timer;
import java.util.TimerTask;

import org.junit.Test;

public class DemoAbstract {
	public static void main(String[] args) {
//		Circle circle = new Circle();
//		printArea(circle);
		
		Timer timer = new Timer();
		
		timer.schedule(new PrintTask(), 2000);
		timer.schedule(new PrintTask(), 2000, 1000);
	}
	
	public static void printArea(Shape shape) {
		System.out.println(shape.getArea());
	}
	
	@Test
	public void test() {
		// 抽象类不能被实例化
		// Shape shape = new Shape();
	}
}

class PrintTask extends TimerTask {
	@Override
	public void run() {
		System.out.println("我正在努力学习中。。。");
	}
}
